package pl.wroc.uni.ii.puzzleWS.data;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;

@Entity
@SequenceGenerator(name="seq", initialValue=1, allocationSize=100)
public class Score implements Serializable {
	
	private static final long serialVersionUID = -553589985641842016L;

	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seq")
	@Id
	private Long id;
	private Long score;	
	private String name;
	@Basic
	private Date date;
	private String hardship;

	public Score(Long id, Long score, String name, Date date, String hardship) {
		this.id = id;
		this.score = score;
		this.name = name;
		this.date = date;
		this.hardship = hardship;
	}
	
	public Score() {
		
	}

	public Long getScore() {
		return score;
	}

	public void setScore(Long score) {
		this.score = score;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getHardship() {
		return hardship;
	}

	public void setHardship(String hardship) {
		this.hardship = hardship;
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	
	@Override
	public String toString() {
		return Long.toString(score) + " " + hardship + " " + date + " " + name;
	}
}